////
////  UIImageView+webImage.m
////  CCKit
////
////  Created by tucici on 2019/12/5.
////  Copyright © 2019 tucici. All rights reserved.
////
//
//#import "UIImageView+webImage.h"
//#import "CCWebImage.h"
//#import "CCConstraint.h"
//#import "UIView+CCLayoutConstraint.h"
//#import <objc/runtime.h>
//@interface UIImageView (webImage)
//@property (nonatomic, copy) NSString *tagStr;
//@end
//static NSString *tagStrKey = @"tagStrKey"; //那么的key
//@implementation UIImageView (webImage)
//- (void)setImageWithURL:(NSURL*)url placeholderImage:(nullable UIImage *)placeholderImage
//{
//    self.tagStr = url.absoluteString;
//    self.image = placeholderImage;
//    if (url)
//    {
//        [CCWebImage downloadImage:url complete:^(UIImage * _Nonnull image, NSURL * _Nonnull url, NSError * _Nonnull error) {
//            dispatch_async(dispatch_get_main_queue(), ^{
//                if ([self.tagStr isEqualToString:url.absoluteString] && image)
//                {
//                    self.image = image;
//                    
//                    CGFloat times = MIN(self.superview.bounds.size.height /image.size.height, self.superview.bounds.size.width / image.size.width);
//                    
//                    self.c_size.c_equal(CGSizeMake(image.size.width * times, image.size.height * times));
//                }
//                else
//                {
//                    NSLog(@"");
//                }
//            });
//        }];
//    }
//}
//- (void)setTagStr:(NSString *)tagStr
//{
//    if (tagStr)
//    {
//        objc_setAssociatedObject(self, &tagStrKey, tagStr, OBJC_ASSOCIATION_COPY);
//    }
//}
//- (NSString *)tagStr
//{
//    return objc_getAssociatedObject(self, &tagStrKey);
//}
//@end
